const {request}=require("../utils/request")
const config = require('../utils/config');
module.exports = {
    addImg: async ({ _id, url }) => {
        //新增图片是修改
        var options = {
            method: 'patch',
            uri: `${config["server-server"]}/admin/${_id}/images/${encodeURIComponent(url)}`,
            json: true // Automatically stringifies the body to JSON
        };
        return await request(options);
    },
    removeImg:({ _id, url })=>{
            //新增图片是修改
            var options = {
                method: 'delete',
                uri: `${config["server-server"]}/admin/${_id}/images/${encodeURIComponent(url)}`,
                json: true // Automatically stringifies the body to JSON
            };
            return  request(options);
    }
}